﻿using System;

namespace Ucto.ToExcelConvertor.Tests
{
	public class DataReaderMock : IDataReader
	{
		private int count;
		private int currentIndex;

		public DataReaderMock(int count)
		{
			this.count = count - 1;
		}

		public string GetNextValue()
		{
			string result = null;

			if (!IsFinished)
			{
				Increment();
				result = MockResources.FirstValue;
			}

			return result;
		}

		public DataHeader GetHeader()
		{
			return null;
		}

		public void Dispose()
		{
		}

		protected void Increment()
		{
			currentIndex++;
		}

		protected bool IsFinished
		{
			get
			{
				return currentIndex > count;
			}
		}
	}
}
